﻿using LPLS.Commons.DBModule;
using LPLS.DBEntities;
using LPLS.DBEntities.DataCollectionModels;
using LPLS.DBInterface.DataCollectionModels;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LPLS.DBServices.DataCollectionModels
{
    public class DataCollectionRecordTempService : DBBaseService, IDataCollectionRecordTempService
    {
        public DataCollectionRecordTempService(DBContext dbContext) : base(dbContext)
        {
        }

        public int AddData(DataCollectionRecordTemp data)
        {
          return this.Client.Insertable<DataCollectionRecordTemp>(data).ExecuteCommand();
        }

        public int DeleteData(DataCollectionRecordTemp data)
        {
            return this.Client.Deleteable(data).ExecuteCommand();
        }

        public List<DataCollectionRecordTemp> GetData()
        {

            var data= this.Client.Queryable<DataCollectionRecordTemp>().ToList();
            return data;
        }

        public override void InitDataBaseName()
        {
            DataBaseName = DatabaseEnum.CollectionConfigDB.ToString();
        }

        public int UpdateData(DataCollectionRecordTemp data)
        {
            return this.Client.Updateable(data).ExecuteCommand();
        }
    }
}
